bitkeeper revision 1.1441 (428af44dQBVBR-lJOrBaoNhpMx9hXg)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 18 May 2005 07:52:45 +0000 (07:52 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 18 May 2005 07:52:45 +0000 (07:52 +0000)
x86/64 fixes.
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Scott Parish <srparish@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/x86_64/entry.S
xen/include/asm-x86/x86_64/current.h

index 5c198494abe10c6a4eab2491483bdb02f6151962..e10562dc22e18b7ca0c77019e9b7f3389e501bbc 100644 (file)
@@ -314,10 +314,10 @@ FLT4:   movq  %rax,16(%rsi)             # RFLAGS
         movq  EDOMAIN_vcpu_info(%rbx),%rax
         pushq VCPUINFO_upcall_mask(%rax)
         testb $TBF_INTERRUPT,%cl
-        setnz VCPUINFO_upcall_mask(%eax)# TBF_INTERRUPT -> clear upcall mask
+        setnz VCPUINFO_upcall_mask(%rax)# TBF_INTERRUPT -> clear upcall mask
         popq  %rax
         shll  $16,%eax                  # Bits 16-23: saved_upcall_mask
-        movw  UREGS_cs+8(%esp),%ax      # Bits  0-15: CS
+        movw  UREGS_cs+8(%rsp),%ax      # Bits  0-15: CS
 FLT5:   movq  %rax,8(%rsi)              # CS/saved_upcall_mask
         movq  UREGS_rip+8(%rsp),%rax
 FLT6:   movq  %rax,(%rsi)               # RIP
index 1b06998bb2e3c2261e0ff9c43bdf6de248c8503d..ffa8d73cdfe7b03be1836c550c1addef7fd6c08b 100644 (file)
@@ -5,7 +5,7 @@
 struct domain;
 
 #define STACK_RESERVED \
-    (sizeof(struct cpu_user_regs) + sizeof(struct domain *))
+    (sizeof(struct cpu_user_regs) + sizeof(struct domain *) + 8)
 
 static inline struct exec_domain *get_current(void)
 {
@@ -34,15 +34,17 @@ static inline struct cpu_user_regs *guest_cpu_user_regs(void)
 
 /*
  * Get the bottom-of-stack, as stored in the per-CPU TSS. This is actually
- * 40 bytes before the real bottom of the stack to allow space for:
- *  domain pointer, DS, ES, FS, GS
+ * 48 bytes before the real bottom of the stack to allow space for:
+ * domain pointer, padding, DS, ES, FS, GS. The padding is required to
+ * have the stack pointer 16-byte aligned: the amount we subtract from
+ * STACK_SIZE *must* be a multiple of 16.
  */
 static inline unsigned long get_stack_bottom(void)
 {
     unsigned long p;
     __asm__( "andq %%rsp,%0; addq %2,%0"
            : "=r" (p)
-           : "0" (~(STACK_SIZE-1)), "i" (STACK_SIZE-40) );
+           : "0" (~(STACK_SIZE-1)), "i" (STACK_SIZE-48) );
     return p;
 }